// 使用nodejs模拟Java后台 生成签名以及扫链操作
const mysql = require('mysql');

const connection = mysql.createConnection({
    host: '192.168.77.246',
    user: 'root',
    password: 'Ct123456',
    port: '3306',
    database: 'contractwallert',
});
connection.connect((err, args) => {
    if (err) {
        return;
    }
    connection.query("use contractwallert")
    const querySql = "select * from config"; //select value from config
    connection.query(querySql, (err, results) => {
        if (!!err) {
            throw err;
        }
        console.log(results)
        if (results && Array.isArray(results)) {
            for (let i = 0; i < results.length; i++) {
                const info = results[i]
                if (info['name'] === 'sys_frr_private_key') {
                    //获取私钥
                    console.log("privateKey", info['value'])
                }else if(info['name']==='nft_mint_rebate_rate'){
                    console.log("rate",info['value'])
                }
            }
        }
    })
});
